const HtmlWebpackPlugin = require("html-webpack-plugin");
const HtmlWebpackInlineSourcePlugin = require("html-webpack-inline-source-plugin");
const config = require("./package.json");

const  Timestamp = new Date().getTime(); 

module.exports = {
  publicPath: "", //使用相对路径
  productionSourceMap: false,
  configureWebpack: {
    plugins: [
      new HtmlWebpackPlugin({
        title: "六爻占卜",
        template: "public/index.html",
        inlineSource: ".(js|css)$", // embed all javascript and css inline
        filename: "hexagram-v" + config.version + ".html"
      }),
      new HtmlWebpackInlineSourcePlugin(),
    ],
    output: { 
      filename: '[name].'+Timestamp+'.js',
      chunkFilename: '[name].'+Timestamp+'.js'
   }
  },
};
